/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cayumapu;

import java.sql.ResultSet;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author Solo_Pescadores
 */
public class JF_Principal_Cayumapu extends javax.swing.JFrame {

    /**
     * Creates new form JF_Principal_Cayumapu
     */
    public JF_Principal_Cayumapu() {
        initComponents();
         JF_NuevoCliente.setVisible(false);
         JF_AdministrarCliente.setVisible(false);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        JDP_Principal = new javax.swing.JDesktopPane();
        JF_AdministrarCliente = new javax.swing.JInternalFrame();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jComboBox1 = new javax.swing.JComboBox();
        jTextField1 = new javax.swing.JTextField();
        jButton1 = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        MC_AC_CLIENTES = new javax.swing.JTable();
        JPanel2 = new javax.swing.JPanel();
        LB_AC_APELLIDOS = new javax.swing.JLabel();
        LB_AC_DIRECCION = new javax.swing.JLabel();
        LB_AC_TELEFONO = new javax.swing.JLabel();
        LB_AC_RUT = new javax.swing.JLabel();
        LB_AC_NOMBRES = new javax.swing.JLabel();
        LB_AC_MAIL = new javax.swing.JLabel();
        TF_AC_TELEFONO = new javax.swing.JTextField();
        TF_AC_MAIL = new javax.swing.JTextField();
        TF_AC_DIRECCION = new javax.swing.JTextField();
        TF_AC_APELLIDOPAT = new javax.swing.JTextField();
        TF_AC_NOMBRES = new javax.swing.JTextField();
        TF_AC_RUT = new javax.swing.JTextField();
        TF_AC_DF = new javax.swing.JTextField();
        PDMCGuion = new javax.swing.JLabel();
        LB_AC_TELEFONO2 = new javax.swing.JLabel();
        TF_AC_TELEFONO2 = new javax.swing.JTextField();
        BT_AC_CANCELAR = new javax.swing.JButton();
        BT_AC_MODIFICAR = new javax.swing.JButton();
        BT_AC_NUEVO = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        TF_AC_APELLIDOMAT = new javax.swing.JTextField();
        JF_NuevoCliente = new javax.swing.JInternalFrame();
        JP_NuevoCliente = new javax.swing.JPanel();
        JL_NC_Nombres = new javax.swing.JLabel();
        JL_NC_Direccion = new javax.swing.JLabel();
        JL_NC_Telefono = new javax.swing.JLabel();
        JL_NC_RUT = new javax.swing.JLabel();
        JL_NC_Paterno = new javax.swing.JLabel();
        JL_NC_Email = new javax.swing.JLabel();
        JL_NC_Materno = new javax.swing.JLabel();
        JL_NC_Guion = new javax.swing.JLabel();
        TF_NC_Telefono = new javax.swing.JTextField();
        TF_NC_EMail = new javax.swing.JTextField();
        TF_NC_Materno = new javax.swing.JTextField();
        TF_NC_Paterno = new javax.swing.JTextField();
        TF_NC_Nombres = new javax.swing.JTextField();
        TF_NC_RUT = new javax.swing.JTextField();
        TF_NC_Direccion = new javax.swing.JTextField();
        TF_NC_Guion = new javax.swing.JTextField();
        JL_NC_Telefono2 = new javax.swing.JLabel();
        TF_NC_Telefono2 = new javax.swing.JTextField();
        JB_NC_Crear = new javax.swing.JButton();
        JB_NC_Cancelar = new javax.swing.JButton();
        JMB_Menu = new javax.swing.JMenuBar();
        JM_MenuCliente = new javax.swing.JMenu();
        JMI_Nuevo = new javax.swing.JMenuItem();
        JMI_Administrar = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jMenu3 = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("JF_Cayumapu");

        JDP_Principal.setBackground(new java.awt.Color(204, 204, 204));
        JDP_Principal.setToolTipText("");

        JF_AdministrarCliente.setClosable(true);
        JF_AdministrarCliente.setDefaultCloseOperation(javax.swing.WindowConstants.HIDE_ON_CLOSE);
        JF_AdministrarCliente.setIconifiable(true);
        JF_AdministrarCliente.setTitle("Administrar Clientes");
        JF_AdministrarCliente.setVisible(true);
        JF_AdministrarCliente.addInternalFrameListener(new javax.swing.event.InternalFrameListener() {
            public void internalFrameClosed(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameClosing(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameOpened(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameActivated(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameDeactivated(javax.swing.event.InternalFrameEvent evt) {
                JF_AdministrarClienteInternalFrameDeactivated(evt);
            }
            public void internalFrameDeiconified(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameIconified(javax.swing.event.InternalFrameEvent evt) {
            }
        });

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Clientes"));

        jLabel1.setText("Buscar");

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Rut", "Nombre", "Telefono" }));

        jButton1.setText("Buscar");

        MC_AC_CLIENTES.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        MC_AC_CLIENTES.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Rut", "Nombre", "Direccion", "Telefono"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        MC_AC_CLIENTES.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                MC_AC_CLIENTESMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(MC_AC_CLIENTES);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 536, Short.MAX_VALUE)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jButton1)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton1))
                .addGap(18, 18, 18)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        JPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createTitledBorder(""), "Datos Cliente"));

        LB_AC_APELLIDOS.setText("Apellido Paterno");

        LB_AC_DIRECCION.setText("Dirección :");

        LB_AC_TELEFONO.setText("Teléfono :");

        LB_AC_RUT.setText("RUT :");

        LB_AC_NOMBRES.setText("Nombres");

        LB_AC_MAIL.setText("E-Mail :");

        TF_AC_RUT.setEditable(false);

        TF_AC_DF.setEditable(false);

        PDMCGuion.setText("-");

        LB_AC_TELEFONO2.setText("Teléfono2 :");

        BT_AC_CANCELAR.setText("Cancelar");
        BT_AC_CANCELAR.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BT_AC_CANCELARActionPerformed(evt);
            }
        });

        BT_AC_MODIFICAR.setText("Modificar");
        BT_AC_MODIFICAR.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BT_AC_MODIFICARActionPerformed(evt);
            }
        });

        BT_AC_NUEVO.setText("Nuevo");
        BT_AC_NUEVO.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BT_AC_NUEVOActionPerformed(evt);
            }
        });

        jLabel2.setText("Apellido Matrerno");

        TF_AC_APELLIDOMAT.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TF_AC_APELLIDOMATActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout JPanel2Layout = new javax.swing.GroupLayout(JPanel2);
        JPanel2.setLayout(JPanel2Layout);
        JPanel2Layout.setHorizontalGroup(
            JPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JPanel2Layout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addGroup(JPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(JPanel2Layout.createSequentialGroup()
                        .addComponent(LB_AC_APELLIDOS, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(JPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, JPanel2Layout.createSequentialGroup()
                                .addComponent(TF_AC_RUT, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(PDMCGuion)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(TF_AC_DF, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(10, 10, 10))
                            .addGroup(JPanel2Layout.createSequentialGroup()
                                .addGroup(JPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(TF_AC_APELLIDOPAT, javax.swing.GroupLayout.DEFAULT_SIZE, 189, Short.MAX_VALUE)
                                    .addComponent(TF_AC_NOMBRES))
                                .addContainerGap())))
                    .addGroup(JPanel2Layout.createSequentialGroup()
                        .addGroup(JPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(BT_AC_NUEVO)
                            .addGroup(JPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(LB_AC_NOMBRES, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(LB_AC_RUT)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(BT_AC_MODIFICAR)
                        .addGap(30, 30, 30)
                        .addComponent(BT_AC_CANCELAR)
                        .addContainerGap())))
            .addGroup(JPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(JPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, JPanel2Layout.createSequentialGroup()
                        .addComponent(LB_AC_MAIL)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(TF_AC_MAIL, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(JPanel2Layout.createSequentialGroup()
                        .addComponent(LB_AC_TELEFONO2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(TF_AC_TELEFONO2, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, JPanel2Layout.createSequentialGroup()
                        .addComponent(LB_AC_TELEFONO)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(TF_AC_TELEFONO, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, JPanel2Layout.createSequentialGroup()
                        .addGroup(JPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(LB_AC_DIRECCION, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel2))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(JPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(TF_AC_DIRECCION)
                            .addComponent(TF_AC_APELLIDOMAT, javax.swing.GroupLayout.DEFAULT_SIZE, 189, Short.MAX_VALUE))))
                .addContainerGap())
        );
        JPanel2Layout.setVerticalGroup(
            JPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(JPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(LB_AC_RUT)
                    .addComponent(TF_AC_RUT, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(PDMCGuion)
                    .addComponent(TF_AC_DF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(JPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(LB_AC_NOMBRES)
                    .addComponent(TF_AC_NOMBRES, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(JPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(LB_AC_APELLIDOS)
                    .addComponent(TF_AC_APELLIDOPAT, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(16, 16, 16)
                .addGroup(JPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(TF_AC_APELLIDOMAT, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(JPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(LB_AC_DIRECCION)
                    .addComponent(TF_AC_DIRECCION, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(JPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(TF_AC_TELEFONO, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(LB_AC_TELEFONO))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(JPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(LB_AC_TELEFONO2)
                    .addComponent(TF_AC_TELEFONO2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(JPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(TF_AC_MAIL, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(LB_AC_MAIL))
                .addGap(18, 18, 18)
                .addGroup(JPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(BT_AC_NUEVO)
                    .addComponent(BT_AC_MODIFICAR)
                    .addComponent(BT_AC_CANCELAR))
                .addContainerGap(19, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout JF_AdministrarClienteLayout = new javax.swing.GroupLayout(JF_AdministrarCliente.getContentPane());
        JF_AdministrarCliente.getContentPane().setLayout(JF_AdministrarClienteLayout);
        JF_AdministrarClienteLayout.setHorizontalGroup(
            JF_AdministrarClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JF_AdministrarClienteLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(JPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(14, Short.MAX_VALUE))
        );
        JF_AdministrarClienteLayout.setVerticalGroup(
            JF_AdministrarClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JF_AdministrarClienteLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(JF_AdministrarClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(JPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(42, Short.MAX_VALUE))
        );

        jPanel1.getAccessibleContext().setAccessibleDescription("");

        JF_AdministrarCliente.setBounds(10, 10, 950, 430);
        JDP_Principal.add(JF_AdministrarCliente, javax.swing.JLayeredPane.DEFAULT_LAYER);

        JF_NuevoCliente.setClosable(true);
        JF_NuevoCliente.setDefaultCloseOperation(javax.swing.WindowConstants.HIDE_ON_CLOSE);
        JF_NuevoCliente.setIconifiable(true);
        JF_NuevoCliente.setTitle("Nuevo Cliente");
        JF_NuevoCliente.setVisible(true);
        JF_NuevoCliente.addInternalFrameListener(new javax.swing.event.InternalFrameListener() {
            public void internalFrameClosed(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameClosing(javax.swing.event.InternalFrameEvent evt) {
                JF_NuevoClienteInternalFrameClosing(evt);
            }
            public void internalFrameOpened(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameActivated(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameDeactivated(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameDeiconified(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameIconified(javax.swing.event.InternalFrameEvent evt) {
            }
        });

        JP_NuevoCliente.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));

        JL_NC_Nombres.setText("Nombres :");

        JL_NC_Direccion.setText("Dirección :");

        JL_NC_Telefono.setText("Teléfono :");

        JL_NC_RUT.setText("RUT :");

        JL_NC_Paterno.setText("Paterno :");

        JL_NC_Email.setText("E-Mail :");

        JL_NC_Materno.setText("Materno :");

        JL_NC_Guion.setText("-");

        TF_NC_RUT.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TF_NC_RUTActionPerformed(evt);
            }
        });
        TF_NC_RUT.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                TF_NC_RUTFocusLost(evt);
            }
        });

        TF_NC_Guion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TF_NC_GuionActionPerformed(evt);
            }
        });
        TF_NC_Guion.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                TF_NC_GuionFocusLost(evt);
            }
        });

        JL_NC_Telefono2.setText("Teléfono2 :");

        javax.swing.GroupLayout JP_NuevoClienteLayout = new javax.swing.GroupLayout(JP_NuevoCliente);
        JP_NuevoCliente.setLayout(JP_NuevoClienteLayout);
        JP_NuevoClienteLayout.setHorizontalGroup(
            JP_NuevoClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JP_NuevoClienteLayout.createSequentialGroup()
                .addGroup(JP_NuevoClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(JP_NuevoClienteLayout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addGroup(JP_NuevoClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, JP_NuevoClienteLayout.createSequentialGroup()
                                .addGroup(JP_NuevoClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(JL_NC_RUT)
                                    .addComponent(JL_NC_Nombres, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(JP_NuevoClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(JP_NuevoClienteLayout.createSequentialGroup()
                                        .addComponent(TF_NC_RUT)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(JL_NC_Guion)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(TF_NC_Guion, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(TF_NC_Nombres, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(0, 0, Short.MAX_VALUE))
                            .addGroup(JP_NuevoClienteLayout.createSequentialGroup()
                                .addGroup(JP_NuevoClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(JL_NC_Direccion, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(JL_NC_Materno)
                                    .addComponent(JL_NC_Telefono2))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addGroup(JP_NuevoClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(TF_NC_Telefono2)
                                    .addComponent(TF_NC_Direccion)
                                    .addComponent(TF_NC_Materno, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 189, Short.MAX_VALUE)))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, JP_NuevoClienteLayout.createSequentialGroup()
                                .addComponent(JL_NC_Paterno)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(TF_NC_Paterno, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(JP_NuevoClienteLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(JL_NC_Telefono)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(TF_NC_Telefono, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(JP_NuevoClienteLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(JL_NC_Email)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(TF_NC_EMail, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        JP_NuevoClienteLayout.setVerticalGroup(
            JP_NuevoClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JP_NuevoClienteLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(JP_NuevoClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JL_NC_RUT)
                    .addComponent(TF_NC_RUT, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JL_NC_Guion)
                    .addComponent(TF_NC_Guion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(JP_NuevoClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(TF_NC_Nombres, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JL_NC_Nombres))
                .addGap(18, 18, 18)
                .addGroup(JP_NuevoClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(TF_NC_Paterno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JL_NC_Paterno))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(JP_NuevoClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(TF_NC_Materno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JL_NC_Materno))
                .addGap(15, 15, 15)
                .addGroup(JP_NuevoClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(TF_NC_Direccion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JL_NC_Direccion))
                .addGap(18, 18, 18)
                .addGroup(JP_NuevoClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JL_NC_Telefono)
                    .addComponent(TF_NC_Telefono, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(JP_NuevoClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(TF_NC_Telefono2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JL_NC_Telefono2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(JP_NuevoClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(TF_NC_EMail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JL_NC_Email))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        JB_NC_Crear.setText("Crear");
        JB_NC_Crear.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JB_NC_CrearActionPerformed(evt);
            }
        });

        JB_NC_Cancelar.setText("Cancelar");
        JB_NC_Cancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JB_NC_CancelarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout JF_NuevoClienteLayout = new javax.swing.GroupLayout(JF_NuevoCliente.getContentPane());
        JF_NuevoCliente.getContentPane().setLayout(JF_NuevoClienteLayout);
        JF_NuevoClienteLayout.setHorizontalGroup(
            JF_NuevoClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JF_NuevoClienteLayout.createSequentialGroup()
                .addGroup(JF_NuevoClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(JF_NuevoClienteLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(JP_NuevoCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(JF_NuevoClienteLayout.createSequentialGroup()
                        .addGap(51, 51, 51)
                        .addComponent(JB_NC_Crear, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(64, 64, 64)
                        .addComponent(JB_NC_Cancelar)))
                .addContainerGap(52, Short.MAX_VALUE))
        );
        JF_NuevoClienteLayout.setVerticalGroup(
            JF_NuevoClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JF_NuevoClienteLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(JP_NuevoCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(JF_NuevoClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JB_NC_Crear)
                    .addComponent(JB_NC_Cancelar))
                .addContainerGap(26, Short.MAX_VALUE))
        );

        JF_NuevoCliente.setBounds(970, 20, 370, 390);
        JDP_Principal.add(JF_NuevoCliente, javax.swing.JLayeredPane.DEFAULT_LAYER);

        JM_MenuCliente.setText("Menu Cliente");

        JMI_Nuevo.setText("Nuevo");
        JMI_Nuevo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JMI_NuevoActionPerformed(evt);
            }
        });
        JM_MenuCliente.add(JMI_Nuevo);

        JMI_Administrar.setText("Administrar");
        JMI_Administrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JMI_AdministrarActionPerformed(evt);
            }
        });
        JM_MenuCliente.add(JMI_Administrar);

        JMB_Menu.add(JM_MenuCliente);

        jMenu2.setText("Edit");
        JMB_Menu.add(jMenu2);

        jMenu3.setText("jMenu3");
        JMB_Menu.add(jMenu3);

        setJMenuBar(JMB_Menu);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(JDP_Principal, javax.swing.GroupLayout.PREFERRED_SIZE, 1374, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(JDP_Principal, javax.swing.GroupLayout.PREFERRED_SIZE, 1219, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void TF_NC_RUTActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TF_NC_RUTActionPerformed
        // TODO add your handling code here:      
    }//GEN-LAST:event_TF_NC_RUTActionPerformed

    private void TF_NC_RUTFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_TF_NC_RUTFocusLost
        // TODO add your handling code here:
        try {
            Integer.parseInt(TF_NC_RUT.getText());
            if (Integer.parseInt(TF_NC_RUT.getText()) <= 0 && Integer.parseInt(TF_NC_RUT.getText()) >= 100000000) {
                JOptionPane.showMessageDialog(this, "El RUT es inválido.", "Aviso", JOptionPane.INFORMATION_MESSAGE);
            }
        } catch (NumberFormatException nfe) {
            JOptionPane.showMessageDialog(this, "Debe ingresar valores numéricos.", "Aviso", JOptionPane.INFORMATION_MESSAGE);
        }



    }//GEN-LAST:event_TF_NC_RUTFocusLost

    private void TF_NC_GuionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TF_NC_GuionActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_TF_NC_GuionActionPerformed

    private void TF_NC_GuionFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_TF_NC_GuionFocusLost
        // TODO add your handling code here:
        Ctrl_VerificarRut guion = new Ctrl_VerificarRut();
        if (!TF_NC_Guion.getText().equals(guion.Verificar(Integer.parseInt(TF_NC_RUT.getText())))) {
            JOptionPane.showMessageDialog(this, "Rut o dígito verificador incorrectos.", "Aviso", JOptionPane.INFORMATION_MESSAGE);
        }
    }//GEN-LAST:event_TF_NC_GuionFocusLost

    private void JB_NC_CrearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JB_NC_CrearActionPerformed
        // TODO add your handling code here:
        Ctrl_VerificarRut guion = new Ctrl_VerificarRut();

        int Validacion = -1, telefono, telefono2, celular;
        Ctrl_NuevoCliente Cliente = new Ctrl_NuevoCliente();
        if (TF_NC_Telefono.getText().length() == 0) {
            telefono = 0;
        } else {
            try {
                telefono = Integer.parseInt(TF_NC_Telefono.getText());
            } catch (NumberFormatException nfe) {
                JOptionPane.showMessageDialog(this, "El campo 'Telefono' debe tener sólo números.", "Aviso", JOptionPane.INFORMATION_MESSAGE);
                return;
            }
        }
        if (TF_NC_Telefono2.getText().length() == 0) {
            telefono2 = 0;
        } else {
            try {
                telefono2 = Integer.parseInt(TF_NC_Telefono2.getText());
            } catch (NumberFormatException nfe) {
                JOptionPane.showMessageDialog(this, "El campo 'Telefono2' debe tener sólo números.", "Aviso", JOptionPane.INFORMATION_MESSAGE);
                return;
            }
        }
        Validacion = Cliente.ValidarRut(Integer.parseInt(TF_NC_RUT.getText()));//verifica que el rut no esté en la BD
        if (Validacion == 0) {
            if (!TF_NC_Guion.getText().equals(guion.Verificar(Integer.parseInt(TF_NC_RUT.getText())))) {
                JOptionPane.showMessageDialog(this, "Rut o dígito verificador incorrectos.", "Aviso", JOptionPane.INFORMATION_MESSAGE);
                return;
            } else {
                Validacion = Cliente.NuevoUsuario("insert into CLIENTE (CLI_RUT, CLI_Direccion, CLI_materno, CLI_CORREO, CLI_paterno,cli_nombres, CLI_Telefono, CLI_Telefono2) values ('"+Integer.parseInt(TF_NC_RUT.getText())+"','"+TF_NC_Direccion.getText()+"','"+TF_NC_Materno.getText()+"','"+TF_NC_EMail.getText()+"','"+TF_NC_Paterno.getText()+"','"+TF_NC_Nombres.getText()+"',"+telefono+","+telefono2+")");
            }
        }
        if (Validacion == 1) {
            JOptionPane.showMessageDialog(this, "El Rut ya se encuentra en la base de datos.", "Error", JOptionPane.INFORMATION_MESSAGE);
            return;
        }
        if (Validacion == -1) {
            JOptionPane.showMessageDialog(this, "Problemas de conexion con la base de datos.", "Error", JOptionPane.INFORMATION_MESSAGE);
            return;
        }
        JOptionPane.showMessageDialog(this, "Usuario ingresado correctamente.", "Aviso", JOptionPane.INFORMATION_MESSAGE);

    }//GEN-LAST:event_JB_NC_CrearActionPerformed

    private void JB_NC_CancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JB_NC_CancelarActionPerformed
        // TODO add your handling code here:
        JF_NuevoCliente.setVisible(false);
        TF_NC_RUT.setText("");
        TF_NC_Direccion.setText("");
        TF_NC_Materno.setText("");
        TF_NC_EMail.setText("");
        TF_NC_Guion.setText("");
        TF_NC_Paterno.setText("");
        TF_NC_RUT.setText("");
        TF_NC_Nombres.setText("");
        TF_NC_Telefono.setText("");
        TF_NC_Telefono2.setText("");
    }//GEN-LAST:event_JB_NC_CancelarActionPerformed

    private void JF_NuevoClienteInternalFrameClosing(javax.swing.event.InternalFrameEvent evt) {//GEN-FIRST:event_JF_NuevoClienteInternalFrameClosing
        // TODO add your handling code here:
        JF_NuevoCliente.setVisible(false);
        TF_NC_RUT.setText("");
        TF_NC_Direccion.setText("");
        TF_NC_Materno.setText("");
        TF_NC_EMail.setText("");
        TF_NC_Guion.setText("");
        TF_NC_Paterno.setText("");
        TF_NC_Nombres.setText("");
        TF_NC_Telefono.setText("");
        TF_NC_Telefono2.setText("");
    }//GEN-LAST:event_JF_NuevoClienteInternalFrameClosing

    private void JMI_NuevoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JMI_NuevoActionPerformed
        // TODO add your handling code here:
        JF_NuevoCliente.setVisible(true);
    }//GEN-LAST:event_JMI_NuevoActionPerformed

    private void JMI_AdministrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JMI_AdministrarActionPerformed
     
      Ctrl_MenuCliente CtrlCliente = new Ctrl_MenuCliente();
        ResultSet resultado;
        JF_AdministrarCliente.setVisible(true);
        DefaultTableModel model = (DefaultTableModel)MC_AC_CLIENTES.getModel();
        int i = 0;
        Object datos[]=new Object[3];
        Ctrl_VerificarRut verificarRut = new Ctrl_VerificarRut();
        resultado = CtrlCliente.LlenaListaCliente("SELECT CLI_RUT,cli_nombres,CLI_Direccion, CLI_Telefono FROM CLIENTE order by CLI_RUT");
        try{
        while(resultado.next()){
                datos[0] = String.valueOf(resultado.getInt(1)+"-"+verificarRut.Verificar(resultado.getInt(1)));
                datos[1] = resultado.getString(2);
                datos[2] = resultado.getString(3);
                model.addRow(datos);
            }
        resultado.close();
        }
        catch (Exception ex) {
                System.out.println(ex.getMessage());            
        }
    }//GEN-LAST:event_JMI_AdministrarActionPerformed

    private void BT_AC_CANCELARActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BT_AC_CANCELARActionPerformed
       // TODO add your handling code here:

       
    }//GEN-LAST:event_BT_AC_CANCELARActionPerformed

    private void BT_AC_MODIFICARActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BT_AC_MODIFICARActionPerformed
      
    }//GEN-LAST:event_BT_AC_MODIFICARActionPerformed

    private void BT_AC_NUEVOActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BT_AC_NUEVOActionPerformed
        // TODO add your handling code here:
       JF_NuevoCliente.setVisible(true);

    }//GEN-LAST:event_BT_AC_NUEVOActionPerformed

    private void TF_AC_APELLIDOMATActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TF_AC_APELLIDOMATActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_TF_AC_APELLIDOMATActionPerformed

    private void MC_AC_CLIENTESMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_MC_AC_CLIENTESMouseClicked
        // TODO add your handling code here:
        int fila = MC_AC_CLIENTES.getSelectedRow();
        //Se realiza la extracción del guion y el dígito verificador para hacer la busqueda en la base de datos
        String Rut = MC_AC_CLIENTES.getValueAt(fila, 0).toString().substring(0, MC_AC_CLIENTES.getValueAt(fila, 0).toString().length()-2);
        int RUT = Integer.parseInt(Rut);
        Ctrl_NuevoCliente cCliente = new Ctrl_NuevoCliente();
        ResultSet resultado;
        Ctrl_VerificarRut verificar = new Ctrl_VerificarRut();

        resultado = cCliente.Consulta("SELECT CLI_RUT,cli_nombres,CLI_paterno,CLI_materno, CLI_Direccion, CLI_Telefono, CLI_Telefono2, CLI_CORREO FROM CLIENTE WHERE CLI_RUT = "+RUT);
        try {
            resultado.next();
            TF_AC_RUT.setText(String.valueOf(resultado.getInt(1)));
            TF_AC_NOMBRES.setText(resultado.getString(2));
            TF_AC_APELLIDOPAT.setText(resultado.getString(3));
            TF_AC_APELLIDOMAT.setText(resultado.getString(4));
            TF_AC_DIRECCION.setText(resultado.getString(5));
            TF_AC_TELEFONO.setText(resultado.getString(6));
            TF_AC_TELEFONO2.setText(resultado.getString(7));
            TF_AC_MAIL.setText(resultado.getString(8));           
            TF_AC_DF.setText(verificar.Verificar(RUT));
        }
        catch (Exception ex) {
            System.out.println(ex.getMessage());
        }
    }//GEN-LAST:event_MC_AC_CLIENTESMouseClicked

    private void JF_AdministrarClienteInternalFrameDeactivated(javax.swing.event.InternalFrameEvent evt) {//GEN-FIRST:event_JF_AdministrarClienteInternalFrameDeactivated
        // TODO add your handling code here:
            TF_AC_RUT.setText("");
            TF_AC_NOMBRES.setText("");
            TF_AC_APELLIDOPAT.setText("");
            TF_AC_APELLIDOMAT.setText("");
            TF_AC_DIRECCION.setText("");
            TF_AC_TELEFONO.setText("");
            TF_AC_TELEFONO2.setText("");
            TF_AC_MAIL.setText("");          
            TF_AC_DF.setText("");
    }//GEN-LAST:event_JF_AdministrarClienteInternalFrameDeactivated

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(JF_Principal_Cayumapu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(JF_Principal_Cayumapu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(JF_Principal_Cayumapu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(JF_Principal_Cayumapu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new JF_Principal_Cayumapu().setVisible(true);

            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton BT_AC_CANCELAR;
    private javax.swing.JButton BT_AC_MODIFICAR;
    private javax.swing.JButton BT_AC_NUEVO;
    private javax.swing.JButton JB_NC_Cancelar;
    private javax.swing.JButton JB_NC_Crear;
    private javax.swing.JDesktopPane JDP_Principal;
    private javax.swing.JInternalFrame JF_AdministrarCliente;
    private javax.swing.JInternalFrame JF_NuevoCliente;
    private javax.swing.JLabel JL_NC_Direccion;
    private javax.swing.JLabel JL_NC_Email;
    private javax.swing.JLabel JL_NC_Guion;
    private javax.swing.JLabel JL_NC_Materno;
    private javax.swing.JLabel JL_NC_Nombres;
    private javax.swing.JLabel JL_NC_Paterno;
    private javax.swing.JLabel JL_NC_RUT;
    private javax.swing.JLabel JL_NC_Telefono;
    private javax.swing.JLabel JL_NC_Telefono2;
    private javax.swing.JMenuBar JMB_Menu;
    private javax.swing.JMenuItem JMI_Administrar;
    private javax.swing.JMenuItem JMI_Nuevo;
    private javax.swing.JMenu JM_MenuCliente;
    private javax.swing.JPanel JP_NuevoCliente;
    private javax.swing.JPanel JPanel2;
    private javax.swing.JLabel LB_AC_APELLIDOS;
    private javax.swing.JLabel LB_AC_DIRECCION;
    private javax.swing.JLabel LB_AC_MAIL;
    private javax.swing.JLabel LB_AC_NOMBRES;
    private javax.swing.JLabel LB_AC_RUT;
    private javax.swing.JLabel LB_AC_TELEFONO;
    private javax.swing.JLabel LB_AC_TELEFONO2;
    private javax.swing.JTable MC_AC_CLIENTES;
    private javax.swing.JLabel PDMCGuion;
    private javax.swing.JTextField TF_AC_APELLIDOMAT;
    private javax.swing.JTextField TF_AC_APELLIDOPAT;
    private javax.swing.JTextField TF_AC_DF;
    private javax.swing.JTextField TF_AC_DIRECCION;
    private javax.swing.JTextField TF_AC_MAIL;
    private javax.swing.JTextField TF_AC_NOMBRES;
    private javax.swing.JTextField TF_AC_RUT;
    private javax.swing.JTextField TF_AC_TELEFONO;
    private javax.swing.JTextField TF_AC_TELEFONO2;
    private javax.swing.JTextField TF_NC_Direccion;
    private javax.swing.JTextField TF_NC_EMail;
    private javax.swing.JTextField TF_NC_Guion;
    private javax.swing.JTextField TF_NC_Materno;
    private javax.swing.JTextField TF_NC_Nombres;
    private javax.swing.JTextField TF_NC_Paterno;
    private javax.swing.JTextField TF_NC_RUT;
    private javax.swing.JTextField TF_NC_Telefono;
    private javax.swing.JTextField TF_NC_Telefono2;
    private javax.swing.JButton jButton1;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextField jTextField1;
    // End of variables declaration//GEN-END:variables
}
